<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
use yii\widgets\LinkPager;
use kartik\editable\Editable;

$this->title = Yii::t('app.order', '取消审批');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-room-list">

    <h2 class="page-header"><small>舱房取消审批</small></h2>

	<table class="table">
		<thead><tr>
			<th>订单号</th> 
			<th>舱房</th> 
			<th>取消金额</th> 
			<th>取消原因</th> 
			<th>操作</th> 
		</tr></thead>

		<?php foreach($models as $k=>$model){ ?>
		<tr>
			<td class="col-md-4"> 
				<?= $model->order->product->name ?><br>
				<font><?= $model->order->product->go_time ?></font><br>
				申请人 : <?= isset($model->member->id) ? $model->member->profile->name : '(未设置)'  ?>
			</td>
			<td class="col-md-3"> <?= $model->room ?><br>
				人数 : <?php $arr = json_decode($model->params, true); 
					echo $arr['num'];	
				?>
			</td>
			<td> 
				<?= $model->order->code ?><br> 
				<i class="fa fa-yen">&nbsp;</i><b class="text-danger"><?= $model->room_price ?> </b><br>
				<?= \Yii::$app->params['order_status'][$model->order->status] ?>
			</td>
			<td> <?= $model->desc ?> </td>
			<td> 
    			<?php echo Editable::widget([
    			    'name' => 'price',
					//'value' => \Yii::$app->params['refund'][$model->status],
					'value' => $model->price,
    			    'asPopover' => true,
    			    'header' => '填写扣除金额',
    			    'size'=>'sm',
    			    'formOptions' => ['action'=>'/order/room/check?id='.$model->id, 'method'=>'get'],
    			    'options' => ['class'=>'form-control', 'placeholder' => '扣除金额'] ,
    			]); ?>
			</td>
		</tr>
		<?php } ?>
	</table>
	<!-- ?= LinkPager::widget(['pagination' => $pages]); ? -->
</div>
